from.import views
from django.urls import path

urlpatterns = [
    path('', views.index, name='index'),
    path('books/', views.BookListView.as_view(), name='books'),
    path('book/<int:pk>', views.BookDetailView.as_view(), name='book-detail'),
    path('authors/', views.AuthorListView.as_view(), name='authors'),
    path('author/<int:pk>', views.AuthorDetailView.as_view(), name='author-detail'),
    
    # 新增的URL
    path('book/<int:pk>/review/', views.add_review, name='add-review'),
    path('book/<int:pk>/favorite/', views.toggle_favorite, name='toggle-favorite'),
    path('book/<int:pk>/like/', views.toggle_like, name='toggle-like'),
    path('mybooks/', views.UserFavoriteListView.as_view(), name='my-favorites'),
    path('ranking/', views.ranking_list, name='ranking'),
    
    # 个人推荐页面
    path('recommendations/', views.personal_recommendations, name='recommendations'),
]
